function onEvent(state, methods) {
	let result = {}
	let index = state.webSocket.eventList.map((eb) => {return eb.method}).indexOf(methods);
	if (state.webSocket.eventList.length > 0 && index >= 0) {
		result = Object.assign({}, state.webSocket.eventList[index]);
		state.webSocket.eventList.splice(index, 1);
	}
	return result.data
}
const getters = {
	token: state => state.user.token,
	tel: state => state.user.tel,
	userInfo: state => state.user.userInfo,
	roleCode: state => state.user.roleCode,
	ucId:state=>state.user.userInfo.ucId,
	notice: state => onEvent(state, 'notice'),
	joinChannel: state => onEvent(state, 'joinChannel'),
	fireAlarm: state => onEvent(state, 'fireAlarm'),
	refresh: state => onEvent(state, 'refresh'),
	wbmessage: state => onEvent(state, 'wbmessage'),
	fireStop: state => onEvent(state, 'fireStop'),
}
export default getters
